CC=g++
OBJECTS=$(patsubst %.cpp,%.o,$(wildcard *.cpp))
OBJECTS_DIR=$(patsubst %.cpp,%.o,$(wildcard *.cpp))

CFLAGS=-Wall -g
LFLAGS=-L ${OPENCV_LIB_PATH} `pkg-config opencv --libs` -Llib/ 
IFLAGS=-I /usr/local/include/opencv/

# if looking for library flags, try command "${libname}-config --ldflags"
# or "pkg-config ${libname} --libs"

all : main

main : $(OBJECTS) 
	$(CC) $(CFLAGS) $(IFLAGS) $(OBJECTS_DIR) $(LFLAGS) -o $@

%.o : %.cpp
	$(CC) $(CFLAGS) $(IFLAGS) $(LFGLAGS) -c $<

archive : 
	tar -cvf archive.tar makefile src/*.cpp include/*.h include/*.hpp
	gzip archive.tar

clean :
	rm -rf main *.o
